package com.example.demo.niuke;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * @Author: liull
 * @Description: 找出给定字符串中大写字符(即 ' A ' - ' Z ')的个数
 * 接口说明
 * 原型：int CalcCapital(String str);
 * 返回值：in
 * 使用HashSet，c2构成的set包含每一个c1的字符则返回true
 * @Date: Created in 13:10 2020/4/1
 * @Modified By:
 */
public class Main45 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line;
        //        System.out.println(Arrays.toString("127.0.0.1".split("\\.")));
        while ((line = br.readLine()) != null) {
            System.out.println(calcCapital(line));
        }

    }

    private static int calcCapital(String line) {
        char[] chars = line.toCharArray();
        int count = 0;
        for (char c : chars) {
            if ('A' <= c && c <= 'Z') {
                ++count;
            }
        }
        return count;
    }

}